﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.IsPostBack)
        {
            BindNews();
            BindGXJS();
            BindCPTJ();
            BindGSGG();
        }
    }

    public void BindNews() {
        DataTable dt = new DataTable();
        SqlHelper.FillDataTable("select top 8 * from news where classid=332 order by id desc", dt);
        this.DataList1.DataSource = dt;
        this.DataList1.DataBind();
    }

    public void BindGXJS() {
        DataTable dt = new DataTable();
        SqlHelper.FillDataTable("select top 10 * from news  where classid in(304,317) order by id desc", dt);
        this.DataList2.DataSource = dt;
        this.DataList2.DataBind();
    }

    public void BindCPTJ()
    {
        DataTable dt = new DataTable();
        SqlHelper.FillDataTable("select top 10 * from news where classid in(334,335) order by id desc", dt);
        this.DataList3.DataSource = dt;
        this.DataList3.DataBind();
    }

    public void BindGSGG()
    {
        DataTable dt = new DataTable();
        SqlHelper.FillDataTable("select top 6 * from news where classid=333 order by id desc", dt);
        this.DataList4.DataSource = dt;
        this.DataList4.DataBind();
    }
}
